//
//  HMMusicImageView.m
//  HowToDo
//
//  Created by Apple on 17/1/6.
//  Copyright © 2017年 KY. All rights reserved.
//

#import "HMMusicImageView.h"

@interface HMMusicImageView ()

//  图片集合
@property (nonatomic, strong) NSMutableArray *imageArray;

@end

@implementation HMMusicImageView


+ (instancetype)musicImageView {

    HMMusicImageView *imageView = [[HMMusicImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"navbar_playing_icon_anim_1"];
    
//    main_audio_playing_1
    
    
    return imageView;

}


- (NSArray *)imageArray {
    if (!_imageArray) {
        _imageArray = [NSMutableArray array];
        
        for (int i = 1; i <= 10; i++) {
            NSString *imageName = [NSString stringWithFormat:@"navbar_playing_icon_anim_%zd", i];
//            main_audio_playing_%zd
            UIImage *image = [UIImage imageNamed: imageName];
            [_imageArray addObject:image];
        }
        
    }
    return _imageArray;
}

//  开启动画
- (void)musicStartAnimation {
    //  设置图片数组
    self.animationImages = self.imageArray;
    self.animationDuration = self.imageArray.count * 0.1;
    //  开启动画
    [self startAnimating];
    
}

//  停止动画
- (void)musicStopAnimation {
    //  停止动画
    [self stopAnimating];
}

@end
